﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RM2012Server.Model;
using System.Data;
using RM2012Server.Business;

namespace RM2012Server.Controller
{
    public class InventoryDetailCtrl
    {
        InventoryDetailDAO m_DetailDAO = new InventoryDetailDAO();

        public DataTable GetAll()
        {
            return m_DetailDAO.GetAll();
        }

        public DataTable GetByInventoryId(String inventoryId)
        {
            return m_DetailDAO.GetByInventoryId(inventoryId);
        }

        public DataTable GetByInventoryIdFull(String inventoryId)
        {
            return m_DetailDAO.GetByInventoryIdFull(inventoryId);
        }

        public DataTable GetByInventoryAndMaterial(String inventoryId, String materialId)
        {
            return m_DetailDAO.GetByInventoryAndMaterial(inventoryId, materialId);
        }

        public int Add(InventoryDetailInfo info)
        {
            return m_DetailDAO.Add(info);
        }

        public int Update(InventoryDetailInfo info)
        {
            return m_DetailDAO.Update(info);
        }

        public int Delete(InventoryDetailInfo info)
        {
            return m_DetailDAO.Delete(info);
        }

        public DataRow AddNewRow()
        {
            return m_DetailDAO.AddNewRow();
        }

        public void AddNewInventoryDetail(DataRow m_Row)
        {
            m_DetailDAO.AddNewInventoryDetail(m_Row);
        }

        public bool SaveData()
        {
            return m_DetailDAO.SaveData();
        }
    }
}
